apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: request-mirror
  namespace: gateway-conformance-infra
spec:
  parentRefs:
  - name: same-namespace
  rules:
  - matches:
    - path:
        type: PathPrefix
        value: /mirror
    filters:
    - type: RequestMirror
      requestMirror:
        backendRef:
          name: infra-backend-v2
          namespace: gateway-conformance-infra
          port: 8080
    backendRefs:
    - name: infra-backend-v1
      port: 8080
      namespace: gateway-conformance-infra
  - matches:
    - path:
        type: PathPrefix
        value: /mirror-and-modify-headers
    filters:
    - type: RequestHeaderModifier
      requestHeaderModifier:
        set:
        - name: X-Header-Set
          value: set-overwrites-values
        add:
        - name: X-Header-Add
          value: header-val-1
        - name: X-Header-Add-Append
          value: header-val-2
        remove:
        - X-Header-Remove
    - type: RequestMirror
      requestMirror:
        backendRef:
          name: infra-backend-v2
          namespace: gateway-conformance-infra
          port: 8080
    backendRefs:
    - name: infra-backend-v1
      port: 8080
      namespace: gateway-conformance-infra
